package com.qf4.web;

import com.qf4.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainTest {
    public static void main(String[] args) {
        //获取容器对象
        ApplicationContext ioc = new ClassPathXmlApplicationContext("spring-aop.xml");
        //通过容器获取容器中的Bean
        UserService userService = ioc.getBean(UserService.class);
        //执行bean的操作
        userService.findAll();
        System.out.println("----------------");
        userService.findById(50);
        System.out.println("----------------");
        int i = userService.insert("zs", "123", 17);
        System.out.println(i);

        //需求：对service层下所有对象的find相关方法进行缓存的处理（在目标方法之前，执行缓存查询）
    }
}
